{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "CNN_Implementation.ipynb",
      "provenance": [],
      "authorship_tag": "ABX9TyOeeY6XRSB3SsQGHW7mkKJ8"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "5xVALNYBurlN"
      },
      "source": [
        "# **SAR Target/Object Detection Using Deep Learning(CNN)**\n",
        "\n",
        "The notebook represents real time implementation of data processing, model building and testing of CNN Algorithm for detection of the target in MSTAR dataset."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "b2NE9xska8sd",
        "outputId": "e38b655d-5be0-4f00-daad-fd2f36685674"
      },
      "source": [
        "from google.colab import drive\n",
        "drive.mount('/content/gdrive')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Mounted at /content/gdrive\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "glfdH__9bHpg"
      },
      "source": [
        "from keras.layers import Conv2D, MaxPooling2D\n",
        "from keras.layers import Activation, Dropout, Flatten, Dense,Input,Multiply\n",
        "from keras.optimizers import SGD\n",
        "from keras.preprocessing.image import ImageDataGenerator\n",
        "from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D\n",
        "from keras.layers import Activation, Dropout, Flatten, Dense\n",
        "import numpy as np\n",
        "from keras import backend as K\n",
        "from keras.models import Model\n",
        "from keras.callbacks import EarlyStopping"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "MKrDUjkKbWSX"
      },
      "source": [
        "train_data_dir = '/content/gdrive/My Drive/data/train/'\n",
        "validation_data_dir = '/content/gdrive/My Drive/data/test/'"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "62O-IUmibwdU"
      },
      "source": [
        "img_height, img_width=100,100\n",
        "epochs = 100\n",
        "batch_size = 16\n",
        "nb_train_samples = 2049\n",
        "nb_validation_samples = 1838"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "vHPUTywxb0zk"
      },
      "source": [
        "train_datagen = ImageDataGenerator(\n",
        "        rescale=1./255,\n",
        "        shear_range=0.2,\n",
        "        rotation_range=10.,\n",
        "        zoom_range=0.2,\n",
        "        horizontal_flip=True)\n",
        "test_datagen = ImageDataGenerator(rescale=1./255)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "SNL-WBLHb4SU",
        "outputId": "f5baf38c-cf14-4224-cd43-146ea75dd65a"
      },
      "source": [
        "train_generator = train_datagen.flow_from_directory(\n",
        "        train_data_dir,\n",
        "        target_size=(img_height, img_width),\n",
        "        batch_size=batch_size,\n",
        "        class_mode='categorical')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Found 2536 images belonging to 10 classes.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "NepEi6I5b-Kc",
        "outputId": "926a5e48-ea6a-4da5-adaa-5813e950093f"
      },
      "source": [
        "\n",
        "validation_generator = test_datagen.flow_from_directory(\n",
        "        validation_data_dir,\n",
        "        target_size=(img_height, img_width),\n",
        "        batch_size=batch_size,\n",
        "        class_mode='categorical')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Found 2636 images belonging to 10 classes.\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "xqzfxBFTcLRk"
      },
      "source": [
        "inputs = Input(shape=(100,100,3))\n",
        "x = Conv2D(8, kernel_size=(5, 5), activation='relu')(inputs)\n",
        "x = MaxPooling2D(pool_size=(2, 2))(x)\n",
        "x = Conv2D(16, kernel_size=(5, 5), activation='relu')(x)\n",
        "x = MaxPooling2D(pool_size=(2, 2))(x)\n",
        "x = Conv2D(32, kernel_size=(5, 5), activation='relu')(x)\n",
        "x = MaxPooling2D(pool_size=(2, 2))(x)\n",
        "x = Flatten()(x)\n",
        "x = Dense(120, activation='relu')(x)\n",
        "x = Dense(84, activation='relu')(x)\n",
        "x = Dense(10, activation='softmax')(x)\n",
        "cnn_model = Model(inputs=inputs,outputs = x)"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "LVhSjedycS_l"
      },
      "source": [
        "cnn_model.compile(loss='categorical_crossentropy',\n",
        "              optimizer = SGD(lr=1e-3,momentum=0.9),#SGD(lr=1e-3,momentum=0.9)\n",
        "              metrics=['accuracy'])"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ANdHQwHGceVM",
        "outputId": "695012aa-98ed-4d20-84fb-89a3f07beea3"
      },
      "source": [
        "cnn_model_history = cnn_model.fit_generator(\n",
        "        train_generator,\n",
        "        steps_per_epoch=nb_train_samples// batch_size ,\n",
        "        epochs=epochs,\n",
        "        validation_data=validation_generator,\n",
        "        validation_steps=nb_validation_samples// batch_size,\n",
        "        workers = 4)"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "WARNING:tensorflow:From <ipython-input-10-07920718d652>:7: Model.fit_generator (from tensorflow.python.keras.engine.training) is deprecated and will be removed in a future version.\n",
            "Instructions for updating:\n",
            "Please use Model.fit, which supports generators.\n",
            "Epoch 1/100\n",
            "128/128 [==============================] - 388s 3s/step - loss: 2.2076 - accuracy: 0.1975 - val_loss: 1.8933 - val_accuracy: 0.3361\n",
            "Epoch 2/100\n",
            "128/128 [==============================] - 83s 647ms/step - loss: 1.5392 - accuracy: 0.4043 - val_loss: 1.2851 - val_accuracy: 0.5115\n",
            "Epoch 3/100\n",
            "128/128 [==============================] - 24s 186ms/step - loss: 1.1808 - accuracy: 0.5549 - val_loss: 1.0628 - val_accuracy: 0.5927\n",
            "Epoch 4/100\n",
            "128/128 [==============================] - 11s 89ms/step - loss: 1.0083 - accuracy: 0.6118 - val_loss: 0.8312 - val_accuracy: 0.6694\n",
            "Epoch 5/100\n",
            "128/128 [==============================] - 9s 72ms/step - loss: 0.8184 - accuracy: 0.6814 - val_loss: 0.6064 - val_accuracy: 0.7615\n",
            "Epoch 6/100\n",
            "128/128 [==============================] - 8s 66ms/step - loss: 0.6621 - accuracy: 0.7495 - val_loss: 0.5486 - val_accuracy: 0.8021\n",
            "Epoch 7/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.6257 - accuracy: 0.7569 - val_loss: 0.4236 - val_accuracy: 0.8410\n",
            "Epoch 8/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.5495 - accuracy: 0.7881 - val_loss: 0.4765 - val_accuracy: 0.8279\n",
            "Epoch 9/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.5199 - accuracy: 0.8015 - val_loss: 0.4109 - val_accuracy: 0.8459\n",
            "Epoch 10/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.4305 - accuracy: 0.8442 - val_loss: 0.4397 - val_accuracy: 0.8317\n",
            "Epoch 11/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.4257 - accuracy: 0.8392 - val_loss: 0.3025 - val_accuracy: 0.9030\n",
            "Epoch 12/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.3895 - accuracy: 0.8603 - val_loss: 0.2770 - val_accuracy: 0.9024\n",
            "Epoch 13/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.3425 - accuracy: 0.8789 - val_loss: 0.4398 - val_accuracy: 0.8262\n",
            "Epoch 14/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.3781 - accuracy: 0.8535 - val_loss: 0.3070 - val_accuracy: 0.8843\n",
            "Epoch 15/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.3112 - accuracy: 0.8897 - val_loss: 0.2531 - val_accuracy: 0.9211\n",
            "Epoch 16/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.2774 - accuracy: 0.8922 - val_loss: 0.2624 - val_accuracy: 0.9106\n",
            "Epoch 17/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.2985 - accuracy: 0.8848 - val_loss: 0.1817 - val_accuracy: 0.9353\n",
            "Epoch 18/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.2688 - accuracy: 0.9029 - val_loss: 0.2048 - val_accuracy: 0.9254\n",
            "Epoch 19/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.2353 - accuracy: 0.9196 - val_loss: 0.2247 - val_accuracy: 0.9156\n",
            "Epoch 20/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.2345 - accuracy: 0.9167 - val_loss: 0.2636 - val_accuracy: 0.8925\n",
            "Epoch 21/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.2211 - accuracy: 0.9221 - val_loss: 0.1199 - val_accuracy: 0.9589\n",
            "Epoch 22/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.2141 - accuracy: 0.9243 - val_loss: 0.1927 - val_accuracy: 0.9282\n",
            "Epoch 23/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.2025 - accuracy: 0.9211 - val_loss: 0.1290 - val_accuracy: 0.9534\n",
            "Epoch 24/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.1849 - accuracy: 0.9338 - val_loss: 0.1184 - val_accuracy: 0.9644\n",
            "Epoch 25/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1799 - accuracy: 0.9319 - val_loss: 0.1898 - val_accuracy: 0.9309\n",
            "Epoch 26/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1656 - accuracy: 0.9500 - val_loss: 0.1159 - val_accuracy: 0.9589\n",
            "Epoch 27/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1538 - accuracy: 0.9407 - val_loss: 0.0873 - val_accuracy: 0.9715\n",
            "Epoch 28/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.1424 - accuracy: 0.9505 - val_loss: 0.1055 - val_accuracy: 0.9644\n",
            "Epoch 29/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1683 - accuracy: 0.9426 - val_loss: 0.1317 - val_accuracy: 0.9523\n",
            "Epoch 30/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1466 - accuracy: 0.9451 - val_loss: 0.1339 - val_accuracy: 0.9490\n",
            "Epoch 31/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.1388 - accuracy: 0.9546 - val_loss: 0.0982 - val_accuracy: 0.9693\n",
            "Epoch 32/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.1285 - accuracy: 0.9578 - val_loss: 0.0587 - val_accuracy: 0.9830\n",
            "Epoch 33/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.1058 - accuracy: 0.9652 - val_loss: 0.0838 - val_accuracy: 0.9704\n",
            "Epoch 34/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.1750 - accuracy: 0.9422 - val_loss: 0.0972 - val_accuracy: 0.9731\n",
            "Epoch 35/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.0867 - accuracy: 0.9676 - val_loss: 0.0629 - val_accuracy: 0.9775\n",
            "Epoch 36/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.1341 - accuracy: 0.9539 - val_loss: 0.0944 - val_accuracy: 0.9649\n",
            "Epoch 37/100\n",
            "128/128 [==============================] - 7s 58ms/step - loss: 0.0823 - accuracy: 0.9725 - val_loss: 0.0936 - val_accuracy: 0.9655\n",
            "Epoch 38/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1071 - accuracy: 0.9647 - val_loss: 0.0805 - val_accuracy: 0.9731\n",
            "Epoch 39/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0990 - accuracy: 0.9648 - val_loss: 0.0869 - val_accuracy: 0.9748\n",
            "Epoch 40/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1100 - accuracy: 0.9619 - val_loss: 0.0623 - val_accuracy: 0.9803\n",
            "Epoch 41/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.1034 - accuracy: 0.9618 - val_loss: 0.0887 - val_accuracy: 0.9677\n",
            "Epoch 42/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0964 - accuracy: 0.9639 - val_loss: 0.0750 - val_accuracy: 0.9764\n",
            "Epoch 43/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0782 - accuracy: 0.9692 - val_loss: 0.0619 - val_accuracy: 0.9781\n",
            "Epoch 44/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0924 - accuracy: 0.9676 - val_loss: 0.1019 - val_accuracy: 0.9616\n",
            "Epoch 45/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0811 - accuracy: 0.9696 - val_loss: 0.0626 - val_accuracy: 0.9742\n",
            "Epoch 46/100\n",
            "128/128 [==============================] - 7s 59ms/step - loss: 0.0823 - accuracy: 0.9706 - val_loss: 0.0816 - val_accuracy: 0.9709\n",
            "Epoch 47/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.1003 - accuracy: 0.9688 - val_loss: 0.0877 - val_accuracy: 0.9726\n",
            "Epoch 48/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0806 - accuracy: 0.9701 - val_loss: 0.0501 - val_accuracy: 0.9846\n",
            "Epoch 49/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0697 - accuracy: 0.9780 - val_loss: 0.0932 - val_accuracy: 0.9693\n",
            "Epoch 50/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0624 - accuracy: 0.9775 - val_loss: 0.0496 - val_accuracy: 0.9857\n",
            "Epoch 51/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0727 - accuracy: 0.9725 - val_loss: 0.0756 - val_accuracy: 0.9731\n",
            "Epoch 52/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0770 - accuracy: 0.9750 - val_loss: 0.0591 - val_accuracy: 0.9819\n",
            "Epoch 53/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0384 - accuracy: 0.9893 - val_loss: 0.0526 - val_accuracy: 0.9819\n",
            "Epoch 54/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0754 - accuracy: 0.9736 - val_loss: 0.1516 - val_accuracy: 0.9567\n",
            "Epoch 55/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0661 - accuracy: 0.9789 - val_loss: 0.1552 - val_accuracy: 0.9518\n",
            "Epoch 56/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0554 - accuracy: 0.9794 - val_loss: 0.0563 - val_accuracy: 0.9808\n",
            "Epoch 57/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0699 - accuracy: 0.9725 - val_loss: 0.0522 - val_accuracy: 0.9830\n",
            "Epoch 58/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0601 - accuracy: 0.9824 - val_loss: 0.0534 - val_accuracy: 0.9819\n",
            "Epoch 59/100\n",
            "128/128 [==============================] - 8s 62ms/step - loss: 0.0524 - accuracy: 0.9868 - val_loss: 0.0385 - val_accuracy: 0.9852\n",
            "Epoch 60/100\n",
            "128/128 [==============================] - 8s 62ms/step - loss: 0.0522 - accuracy: 0.9824 - val_loss: 0.0990 - val_accuracy: 0.9655\n",
            "Epoch 61/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0729 - accuracy: 0.9727 - val_loss: 0.0913 - val_accuracy: 0.9688\n",
            "Epoch 62/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0696 - accuracy: 0.9735 - val_loss: 0.1237 - val_accuracy: 0.9529\n",
            "Epoch 63/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0464 - accuracy: 0.9819 - val_loss: 0.0469 - val_accuracy: 0.9852\n",
            "Epoch 64/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0369 - accuracy: 0.9843 - val_loss: 0.0464 - val_accuracy: 0.9836\n",
            "Epoch 65/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0437 - accuracy: 0.9873 - val_loss: 0.0405 - val_accuracy: 0.9857\n",
            "Epoch 66/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0458 - accuracy: 0.9877 - val_loss: 0.0683 - val_accuracy: 0.9770\n",
            "Epoch 67/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0372 - accuracy: 0.9853 - val_loss: 0.0573 - val_accuracy: 0.9803\n",
            "Epoch 68/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0375 - accuracy: 0.9873 - val_loss: 0.0449 - val_accuracy: 0.9819\n",
            "Epoch 69/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0543 - accuracy: 0.9809 - val_loss: 0.0693 - val_accuracy: 0.9709\n",
            "Epoch 70/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0386 - accuracy: 0.9868 - val_loss: 0.0544 - val_accuracy: 0.9797\n",
            "Epoch 71/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0468 - accuracy: 0.9858 - val_loss: 0.0540 - val_accuracy: 0.9836\n",
            "Epoch 72/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0588 - accuracy: 0.9794 - val_loss: 0.0641 - val_accuracy: 0.9786\n",
            "Epoch 73/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0438 - accuracy: 0.9863 - val_loss: 0.0459 - val_accuracy: 0.9846\n",
            "Epoch 74/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0478 - accuracy: 0.9843 - val_loss: 0.0612 - val_accuracy: 0.9841\n",
            "Epoch 75/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0461 - accuracy: 0.9843 - val_loss: 0.0410 - val_accuracy: 0.9852\n",
            "Epoch 76/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0304 - accuracy: 0.9897 - val_loss: 0.0403 - val_accuracy: 0.9896\n",
            "Epoch 77/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0207 - accuracy: 0.9946 - val_loss: 0.0429 - val_accuracy: 0.9885\n",
            "Epoch 78/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0299 - accuracy: 0.9892 - val_loss: 0.0386 - val_accuracy: 0.9885\n",
            "Epoch 79/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0314 - accuracy: 0.9897 - val_loss: 0.0617 - val_accuracy: 0.9775\n",
            "Epoch 80/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0435 - accuracy: 0.9843 - val_loss: 0.0403 - val_accuracy: 0.9874\n",
            "Epoch 81/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0438 - accuracy: 0.9863 - val_loss: 0.0891 - val_accuracy: 0.9720\n",
            "Epoch 82/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0389 - accuracy: 0.9863 - val_loss: 0.0583 - val_accuracy: 0.9797\n",
            "Epoch 83/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0334 - accuracy: 0.9897 - val_loss: 0.0445 - val_accuracy: 0.9846\n",
            "Epoch 84/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0413 - accuracy: 0.9902 - val_loss: 0.0895 - val_accuracy: 0.9655\n",
            "Epoch 85/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0408 - accuracy: 0.9882 - val_loss: 0.0440 - val_accuracy: 0.9863\n",
            "Epoch 86/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0223 - accuracy: 0.9927 - val_loss: 0.0289 - val_accuracy: 0.9896\n",
            "Epoch 87/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0261 - accuracy: 0.9917 - val_loss: 0.0606 - val_accuracy: 0.9803\n",
            "Epoch 88/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0294 - accuracy: 0.9912 - val_loss: 0.0395 - val_accuracy: 0.9885\n",
            "Epoch 89/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0229 - accuracy: 0.9936 - val_loss: 0.0494 - val_accuracy: 0.9841\n",
            "Epoch 90/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0306 - accuracy: 0.9882 - val_loss: 0.0658 - val_accuracy: 0.9808\n",
            "Epoch 91/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0623 - accuracy: 0.9814 - val_loss: 0.0496 - val_accuracy: 0.9857\n",
            "Epoch 92/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0393 - accuracy: 0.9877 - val_loss: 0.0401 - val_accuracy: 0.9846\n",
            "Epoch 93/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0348 - accuracy: 0.9868 - val_loss: 0.0902 - val_accuracy: 0.9715\n",
            "Epoch 94/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0224 - accuracy: 0.9926 - val_loss: 0.0463 - val_accuracy: 0.9797\n",
            "Epoch 95/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0297 - accuracy: 0.9897 - val_loss: 0.0645 - val_accuracy: 0.9770\n",
            "Epoch 96/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0405 - accuracy: 0.9858 - val_loss: 0.0602 - val_accuracy: 0.9770\n",
            "Epoch 97/100\n",
            "128/128 [==============================] - 8s 60ms/step - loss: 0.0194 - accuracy: 0.9927 - val_loss: 0.0500 - val_accuracy: 0.9857\n",
            "Epoch 98/100\n",
            "128/128 [==============================] - 8s 62ms/step - loss: 0.0311 - accuracy: 0.9897 - val_loss: 0.0332 - val_accuracy: 0.9896\n",
            "Epoch 99/100\n",
            "128/128 [==============================] - 8s 61ms/step - loss: 0.0231 - accuracy: 0.9931 - val_loss: 0.0556 - val_accuracy: 0.9825\n",
            "Epoch 100/100\n",
            "128/128 [==============================] - 8s 59ms/step - loss: 0.0223 - accuracy: 0.9926 - val_loss: 0.0526 - val_accuracy: 0.9819\n"
          ],
          "name": "stdout"
        }
      ]
    }
  ]
}